﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="edit_priv.aspx.cs" Inherits="AnyOffice.general.system.user_priv.edit_priv" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>edit_priv</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
		
		<script>

var MENU_ID_ARRAY = new Array();

<% = JavaVar%>

function check_all(menu_all,MENU_ID)
{

 for (i=0;i<document.all(MENU_ID).length;i++)
 {
   if(menu_all.checked)
      document.all(MENU_ID).item(i).checked=true;
   else
      document.all(MENU_ID).item(i).checked=false;
 }

 if(i==0)
 {
   if(menu_all.checked)
      document.all(MENU_ID).checked=true;
   else
      document.all(MENU_ID).checked=false;
 }
}

function mysubmit()
{
  func_id_str="";

  //一级菜单数量
  for(j=1;j<=<%=MenuCount%>;j++)
  {
    menu_id=MENU_ID_ARRAY[j-1]+'';

    for(i=0;i<document.all(menu_id).length;i++)
    {
        el=document.all(menu_id).item(i);
        if(el.checked)
        {  val=el.value;
           func_id_str+=val + ",";
        }
    }

    if(i==0)
    {
        el=document.all(menu_id);
        if(el.checked)
        {  val=el.value;
           func_id_str+=val + ",";
        }
    }
  }
  
  Form1.lblFuncIdStr.value = func_id_str;
  Form1.submit();
}
		</script>
	</HEAD>
	<body class="bodycolor" topMargin="5">
		<form id="Form1" method="post" runat="server">
			<asp:panel id="pnlMain" runat="server">
				<TABLE class="small" cellSpacing="0" cellPadding="3" width="100%" border="0">
					<TR>
						<TD class="Big"><IMG height="20" src="/images/edit.gif" width="22" align="absMiddle"><SPAN class="big3">
								编辑角色权限 - （<asp:label id="lblUserPriv" runat="server"></asp:label>）</SPAN>&nbsp;&nbsp;
								<INPUT class="BigButton" onclick="mysubmit();" type="button" value="确定">&nbsp;&nbsp;
								<INPUT class="BigButton" onclick="location='index.aspx'" type="button" value="返回">
						</TD>
					</TR>
					<TR>
						<TD class="Big"></TD>
					</TR>
				</TABLE>
				<TABLE class="small" cellSpacing="1" cellPadding="3" border="0">
					<TR>
						<TD align="left">
							<asp:literal id="litForm" runat="server" EnableViewState="False"></asp:literal></TD>
					</TR>
					<TR>
						<TD class="TableControl" align="center">
						<INPUT id="lblFuncIdStr" type="hidden" runat="server"><INPUT class="BigButton" onclick="mysubmit();" type="button" value="确定">&nbsp;&nbsp;
							<INPUT class="BigButton" onclick="location='index.aspx'" type="button" value="返回">
						</TD>
					</TR>
				</TABLE>
			</asp:panel>
			<asp:Label id="lblMessage" runat="server"></asp:Label>
		</form>
	</body>
</HTML>
